Previous Book Contents Book Index Next

Inside Macintosh: AppleScript Language Guide / Part 3 - Appendixes
Appendix B - Scriptable Text Editor Dictionary / Scriptable Text Editor Object Class Definitions


Insertion Point

An object of class Insertion Point is a location between characters where text can be inserted. The first insertion point in a container is the place between the beginning of the container and the first character. In the Scriptable Text Editor, insertion points are zero-length text objects. As a result, they have the same properties and elements as text objects.

PROPERTIES
Font
The name of the font of the insertion point.
Class: String
Modifiable? Yes
Length
The number of characters in a text object. For insertion points, the value of the Length property is always 0.
Class: Integer
Modifiable? No
Offset
The number of possible insertion points from the beginning of the document to the insertion point. The first insertion point of a document is the insertion point before the first character.
Class: Integer
Modifiable? No
Size
The point size that is active at an insertion point.
Class: Integer
Modifiable? Yes
Style
The text styles that are active at an insertion point.
Class: Text Style Info. Objects of this class have two properties: On Styles and Off Styles. The On Styles property specifies the styles that are active. The Off Styles property specifies the styles that are not active. Both properties are lists of constants that specify text styles. See "Elements of Text Objects" on page 314 for information about how styles are used. The constants that can be used in Style property lists are bold, italic, outline, underline, and shadow.
Modifiable? Yes
Uniform Styles
The text styles that are uniformly "on" or "off" for all characters of a text object. For insertion points, the Uniform Styles property indicates which text styles are active at the insertion point. It always has the same value as the Style property.
Class: Text Style Info. Objects of this class have two properties: On Styles and Off Styles. See "Elements of Text Objects" on page 314 for information about how styles are used. The constants that can be used in Uniform Styles property lists are bold, italic, outline, underline, and shadow.
Modifiable? No
ELEMENT CLASSES
None

COMMANDS HANDLED
Copy, Count, Data Size, Exists, Get, Set

DEFAULT VALUE CLASS RETURNED
Reference

EXAMPLES
The following statement moves the first word of a document to the insertion point after the tenth word.

tell document "Intro" of app "Scriptable Text Editor"   move word 1 to insertion point after word 10
end tell
The following statement does the same thing:

tell document "Intro" of app "Scriptable Text Editor"   move word 1 to after word 10
end tell
AppleScript allows you to leave out the words insertion point when specifying locations with the Relative reference form. For more information about the Relative reference form, see "Relative" on page 138.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996